<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>NINJA!</title>
    <style>
        #results li.pass{
            color: green;}
        #results li.fail{
            color: red;
        }
    </style>
</head>
<body>

<ui id="results"></ui>

<script>
    //断言
    function assert(value,desc) {
        var li =document.createElement('li');
        li.className = value?'pass':'fail';
        li.appendChild(document.createTextNode(desc));
        document.getElementById('results').appendChild(li);
    }
    window.onload=function () {
        assert(true,'the test suite is running');
        assert(false,'fail');
    };

</script>
</body>
</html>